package com.guangfeng.yql.comm.netty.util;

import io.netty.handler.codec.http.DefaultFullHttpResponse;
import io.netty.handler.codec.http.FullHttpResponse;
import io.netty.handler.codec.http.HttpResponseStatus;
import io.netty.handler.codec.http.HttpVersion;

public class NettyResponseUtils {

    public static ThreadLocal threadLocal;

    public static FullHttpResponse getResponse() {
        FullHttpResponse resp = (FullHttpResponse) threadLocal.get();
        if (resp == null) {
            resp = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
            threadLocal.set(resp);
        }
        return resp;
    }

}
